#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int arr[10] = { 1,3,5,12,2,6,8,11,9 };
	int n = sizeof(arr) / sizeof(arr[0]);
	int sum=0;
	for (int i = 0; i < 10; i++)
	{
		int tmp = arr[0];
		for (int j = 0; j < n-i; j++)
		{
			if (arr[j] >= arr[j + 1])
			{
				tmp = arr[j + 1];
				arr[j + 1] = arr[j];
				arr[j] = tmp;
			}
			
		}

	}
	for (int i = 0; i < 10; i++)
	{
		sum += i;
		printf("%d", arr[i]);
	}
	printf("%d", sum);

}